package com.woniu.zsd.common.util;

import lombok.Data;


@Data
public class Result<T> {
    private Integer code;
    private String message;
    private T data;
    public Result(Integer code, String message, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public Result() {

    }

    public static Result success(String message, Object data){
        return new Result(200, message, data);
    }
    public static Result success(String message){
        return new Result(200, message, null);
    }
    public static Result error(String message){
        return new Result(500, message, null);
    }
}
